<script>
	import i18n from '@/i18n/i18n';
	import $cst_ from '@/utils/constant.js';
	import $utils_ from '@/utils/common.js';
	export default {
		globalData: {
			i18n
		},

		onLaunch: function() {
			console.log('App Launch');

			// 设置语言
			try {
				// let langs = ['zh-CN', 'en'];
				let data = uni.getStorageSync($cst_.KEY_SYS_PARAMS);
				let system_params;
				if (data) {
					system_params = $utils_.JSONParse(data);
				} else {
					system_params = {
						lang: 'en'
					}; // 默认app语言英文
					uni.setStorageSync($cst_.KEY_SYS_PARAMS, $utils_.JSONStringify(system_params));
					console.log("system_params init")
				}


				i18n.locale = system_params.lang;

				console.log("_i18n.locale:", i18n.locale);

				if (system_params.lang === 'en') {
					uni.setLocale("en");
				} else if (system_params.lang === "zh-CN") {
					uni.setLocale("zh-Hans");
				}

			} catch (err) {
				console.error('设置App语言失败！', err);
			}
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide');
		}
	}
</script>

<style>
	/*每个页面公共css */
	page {
		height: 100%;
	}

	view,
	div,
	span {
		font-family: fangsong, -apple-system, BlinkMacSystemFont, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
	}

	/* .uni-picker-container .uni-picker-content {
		background-color: rgb(28, 28, 28);
	} */
	.uni-picker-container .uni-picker-header {
		background-color: rgb(28, 28, 28);
	}

	#rune .uv-tabs__wrapper__nav .uv-tabs__wrapper__nav__item {
		width: 50%;
	}

	#rune .uv-tabs__wrapper__nav {
		border-bottom: 6rpx solid #dcb8b8;
	}

	#rune .uv-tabs__wrapper__nav__line {
		position: absolute;
		bottom: -6rpx;
		height: 6rpx !important;
		width: 60rpx;

	}

	#rune .uv-tabs__wrapper__nav__item__text {
		color: white !important;
	}

	#rune .item_is_actived .uv-tabs__wrapper__nav__item__text {
		color: rgb(0, 122, 255) !important;
	}



	#edit_add_rws .uni-forms-item__label,
	#edit_add_brs .uni-forms-item__label {
		width: 130rpx !important;
		color: #d3d3d3;
		/* padding-right: 24rpx !important; */
	}




	#rune_runewords .HMfilterDropdown .nav {
		background-color: rgb(28, 28, 28) !important;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class.show {
		background-color: rgb(28, 28, 28) !important;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .sub-menu {
		color: white !important;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .sub-menu.on {
		color: rgb(0, 122, 255) !important;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .sub-menu.on .selected {
		color: rgb(0, 122, 255) !important;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .labels {
		color: #d3d3d3;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .title {
		color: #d3d3d3;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .labels .on {
		border-color: #007aff;
		background-color: #007aff;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .btn-box .reset {
		border-color: #d3d3d3;
		color: #d3d3d3;
	}

	#rune_runewords .HMfilterDropdown .sub-menu-class .btn-box .submit {
		border-color: #007aff;
		color: white;
		background-color: #007aff;
	}

	#rune_runewords .HMfilterDropdown .nav .name,
	#rune_runewords .HMfilterDropdown .nav .triangle {
		color: white;
	}
</style>